/***************************************************************************
创建者：　华磊
 开始时间：               : 2020.11.09
 copyright            : (C) 深圳市华友高科有限公司
 修改说明：（每次有修改就添加一条，带有 修改人，修改时间，修改描述）

 ***************************************************************************
 *   程序寸动视窗测试用代理类
*                                                                         *
 ***************************************************************************/
#ifndef JOGDELEGATE_H
#define JOGDELEGATE_H

#include "jogdelegate_global.h"
#include <QDialog>
#include <QObject>
#include <QTimer>
#include <QTranslator>
#include <QApplication>
#include "../JogView/jogview.h"
//#include "../CommunicateDelegate/globaldata.h"
#include "../CommunicateDelegate/moveoperation.h"

#include <stdio.h>
#include <stdlib.h>
#include <time.h>


/**
 * @brief The JogDelegate class   程序寸动视窗测试用代理类
 */
class JOGDELEGATESHARED_EXPORT JogDelegate : public QObject
{
    Q_OBJECT

public:
    JogDelegate(MoveOperation *moveOperationIn,JogView *jogViewIn,
                GlobalData *globalDataIn,QObject* parent=0);
    ~JogDelegate();



signals:
    /**
     * @brief msgBoxSignal                      通知 打开消息框
     */
    //void msgBoxSignal(int type,QString title,QString text);

    void setRightViewCurrentAxis(int axisNumber);
    void changeJogAxisName_signal(bool isJointShow, int totalAxisCountIn, int pageIdIn, int onePageMaxAxisCount);

public slots:
    /**
     * @brief pushButton_L1_pressedSlot  左L1~L6按钮按压时响应槽函数
     */
    void pushButton_L1_pressedSlot();
    void pushButton_L2_pressedSlot();
    void pushButton_L3_pressedSlot();
    void pushButton_L4_pressedSlot();
    void pushButton_L5_pressedSlot();
    void pushButton_L6_pressedSlot();
    void pushButton_L7_pressedSlot();

    /**
     * @brief pushButton_L1_releasedSlot  左L1~L6按钮释放时响应槽函数
     */
    void pushButton_L1_releasedSlot();
    void pushButton_L2_releasedSlot();
    void pushButton_L3_releasedSlot();
    void pushButton_L4_releasedSlot();
    void pushButton_L5_releasedSlot();
    void pushButton_L6_releasedSlot();
    void pushButton_L7_releasedSlot();

    /**
     * @brief pushButton_R1_pressedSlot  右R1~R6按钮按压时响应槽函数
     */
    void pushButton_R1_pressedSlot();
    void pushButton_R2_pressedSlot();
    void pushButton_R3_pressedSlot();
    void pushButton_R4_pressedSlot();
    void pushButton_R5_pressedSlot();
    void pushButton_R6_pressedSlot();
    void pushButton_R7_pressedSlot();

    /**
     * @brief pushButton_R1_releasedSlot  右R1~R6按钮释放时响应槽函数
     */
    void pushButton_R1_releasedSlot();
    void pushButton_R2_releasedSlot();
    void pushButton_R3_releasedSlot();
    void pushButton_R4_releasedSlot();
    void pushButton_R5_releasedSlot();
    void pushButton_R6_releasedSlot();
    void pushButton_R7_releasedSlot();

    /**
     * @brief updateDataAndView             接收middle的控制,更新数据和跟新view
     */
    void updateDataAndView();

    void changeLanguageSlot(int language);

private:
    void initConnect();
    void updateAxisValueShow();
    void updateAxisPropertyShow();

private:
    QTranslator translator;
    /**
     * @brief moveOperation 移动操作对象
     */
    MoveOperation *moveOperation;

    /**
     * @brief jogView       JogView指针对象
     */
    JogView *jogView;

    /**
     * @brief globalData    公共数据指针
     */
    GlobalData *globalData;

private:


    /**
     * @brief axisNumber    当前轴
     */
    int axisNumber;
    /**
     * @brief direction     方向
     */
    int direction;

    /**
     * @brief beforeShowFlag    前一次显示方式,关节?笛卡尔?(本体?外部)
     */
//    int beforeShowFlag;
    /**
     * @brief beforeShowExtFla  前一次显示方式,本体轴?外部轴?
     */
//    bool beforeShowExtFlag;





};


#endif // JOGDELEGATE_H
